<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0,user-scalable=no,minimal-ui">
    <title>菩提阁</title>
    <!--<%&#45;&#45;第一步： 引入jquery&#45;&#45;%>-->
    <script src="/front/js/jquery-3.3.1.js"></script>
    <!--<%&#45;&#45;第一步： 引入QRCode&#45;&#45;%>-->
    <script src="/front/js/qrcode.min.js"></script>
    <link rel="icon" href="./../images/favico.ico">
    <!--不同屏幕尺寸根字体设置-->
    <script src="./../js/base.js"></script>
    <!--element-ui的样式-->
    <link rel="stylesheet" href="../../backend/plugins/element-ui/index.css" />
    <!--引入vant样式-->
    <link rel="stylesheet" href="../styles/vant.min.css"/>
    <!-- 引入样式  -->
    <link rel="stylesheet" href="../styles/index.css" />
    <!--本页面内容的样式-->
    <link rel="stylesheet" href="./../styles/add-order.css" />
</head>
<body>
<div id="add_order" class="app">
    <div class="divHead">
        <div class="divTitle">
            <i class="el-icon-arrow-left" @click="goBack"></i>菩提阁
        </div>
    </div>

    <div type="button" id="but">生成支付二维码</div>

    <div id="QRCode"></div>


</div>




<!-- 开发环境版本，包含了有帮助的命令行警告 -->
<script src="../../backend/plugins/vue/vue.js"></script>
<!-- 引入组件库 -->
<script src="../../backend/plugins/element-ui/index.js"></script>
<!-- 引入vant样式 -->
<script src="./../js/vant.min.js"></script>
<script src="./../api/address.js"></script>
<!-- 引入axios -->
<script src="../../backend/plugins/axios/axios.min.js"></script>
<script src="./../js/request.js"></script>
<script src="./../js/common.js"></script>
<script src="./../api/main.js"></script>
<script src="./../api/order.js"></script>
<script>

    document.getElementById("but").onclick = function () {
        axios.get("/pay/wxpay").then(res=>{
            let result = res.data;
            let url = result.data;
            let qrCode = new QRCode("QRCode",url);
        });
    };

    setInterval(function () {
        axios.get("/pay/findStatus").then(res=>{
            let result = res.data;
            if (result.code == 1){
                location.href = "/front/page/pay-success.html"
            }
        })
    },5000);

    setTimeout(function () {
        axios.get("/pay/findStatus").then(res=>{
            let result = res.data;
            if (result.code == 0){
                location.href = "/front/page/add-order.html"
            }
        });
    },50000)




</script>

</body>
</html>